package cmd

import (
	"gitee.com/xuender/oils/logs"
	"gitee.com/xuender/se"
	"github.com/spf13/cobra"
)

// nolint: gochecknoinits
func init() {
	wordCmd := &cobra.Command{
		Use:   "word",
		Short: "显示词详细信息",
		Long:  `显示词详细信息，包括关联的文件`,
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) == 0 {
				logs.Error("缺少参数，词或词ID")

				return
			}

			app := se.InitApp(se.NewContext(cmd))
			defer app.Close()

			for _, w := range args {
				app.Word(w)
			}
		},
	}

	rootCmd.AddCommand(wordCmd)
}
